Skip to content

feat(gesture): learn from corrections after a swipe - #928

Merged
LeanBitLab merged 1 commit into
mainfrom
feat/gesture-learn-picks
Nov 25, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
feat/gesture-learn-picks

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

Swipe scores are in the tens of millions, so the additive session boost (capped at 32) cannot change a swipe ranking. Close calls (0.3-4% score gaps in a measured 36 word run) were decided by the dictionary only.

  • New GestureWordBias: when a swiped word is replaced by another suggestion, the picked word gets a relative score bonus (+0.5% per pick, max +3%) and the replaced word a malus (-1% per replacement, max -3%), fading with a 14 day half-life. Capped, so a clearly better path match still wins.
  • Hook: InputLogic.onPickSuggestionManually (batch input only, not in incognito); kept swipes undo one rejection; applied in DictionaryFacilitatorImpl for batch input only.
  • Hardening: atomic file write with serialized saves, immediate flush per correction, hostile/corrupt/stale file handling, count and size caps, overflow-safe score maths, file-format-breaking words ignored, cleared with user history and word removal.
  • Tests: GestureWordBiasTest, 16 cases (scoring rule, persistence, corrupt files, limits, concurrency).
  • Checked on device: a swiped word was corrected after 3 picks.

@LeanBitLab
LeanBitLab merged commit a1766d9 into main Nov 25, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the feat/gesture-learn-picks branch November 25, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant